#define kindEditorInit(name)
    KindEditor.ready(function(K) {
        var editor = K.create('textarea[name="#(name??'content')"]', {
        cssPath : '#(contextPath)/assets/lib/kindeditor/plugins/code/prettify.css',
        uploadJson : '#(contextPath)/travel/uploadForKindEditor',
        //fileManagerJson : '#(contextPath)/assets/admin_bootstrap/js/kindeditor/jsp/file_manager_json.jsp',
        afterBlur: function () { editor.sync();},
        });
    });
#end


#define kindEditorInput(name,value)
<textarea name="#(name??'content')" cols="100" rows="8" style="width:700px;height:200px;visibility:hidden;">#(value??"")</textarea>
#end

#define textInput(type,name,id,placeholder,value)
    <input type="#(type??'text')" value="#(value??'')" name="#(name??'')" id="#(id??'')" class="form-control" placeholder="#(placeholder??'')">
#end


#define textAreaInput(name,id,placeholder,value)
    <textarea class="form-control" rows="3" name="#(name??'desc')" id="#(id??'desc')" placeholder="#(placeholder??'请输入文章描述信息...')">#(value??'')</textarea>
#end



#define webUploaderInit()
var uploader = WebUploader.create({
    //自动上传图片信息
    auto: true,
    // swf文件路径
    swf: '#(contextPath)/assets/lib/upload/Uploader.swf',
    // 文件接收服务端。
    server: '#(contextPath)/travel/upload',
    // 选择文件的按钮。可选。
    // 内部根据当前运行是创建，可能是input元素，也可能是flash.
    pick: '#picker',
    // 不压缩image, 默认如果是jpeg，文件上传前会压缩一把再上传！
    resize: false,
    // 只允许选择图片文件。
    accept: {
        title: 'Images',
        extensions: 'gif,jpg,jpeg,bmp,png',
        mimeTypes: 'image/*'
    }
});
uploader.on( 'uploadSuccess', function( file,resp  ) {
    layer.msg("图片上传完成....");
    var json = $.parseJSON(resp._raw)
    var img = json.data;
    $("#img_hidden").val(img);
    var imgEl = "<img src='"+img+"' width='100'>"
    $("#preview").html(imgEl);
});

uploader.on( 'uploadError', function( file ) {
    layer.msg("上传出错了");
});

uploader.on( 'uploadComplete', function( file ) {
    //layer.msg("图片上传完成....");
});
#end


#define webUploaderBtn(obj,name)
<div id="uploader" class="wu-example">
    <!--用来存放文件信息-->
    <div id="preview">
        #if(obj??&&obj.cover??)
        <img src="#(obj.cover??'')" width="100">
        #end
    </div>
    <div class="btns">
        <div id="picker">选择文件</div>
    </div>
    <input type="hidden" id="img_hidden" name="#(name??'')" value="#(obj.cover??'')">
</div>
#end

#define webUploaderMutiInit()
    var uploaderMuti = WebUploader.create({
    //自动上传图片信息
    auto: true,
    // swf文件路径
    swf: '#(contextPath)/assets/lib/upload/Uploader.swf',
    // 文件接收服务端。
    server: '#(contextPath)/travel/upload',
    // 选择文件的按钮。可选。
    // 内部根据当前运行是创建，可能是input元素，也可能是flash.
    pick: '#pickerMuti',
    // 不压缩image, 默认如果是jpeg，文件上传前会压缩一把再上传！
    resize: false,
    // 只允许选择图片文件。
    accept: {
    title: 'Images',
    extensions: 'gif,jpg,jpeg,bmp,png',
    mimeTypes: 'image/*'
    }
    });
    uploaderMuti.on( 'uploadSuccess', function( file,resp  ) {
        layer.msg("图片上传完成....");
        var json = $.parseJSON(resp._raw)
        var img = json.data;
        $("#img_muti_hidden").val(img);
        var imgEl = "<div style='padding:5px;' class='imgWrap'><img src='"+img+"' class='img-item' width='100'><p class='del-pic' style='text-align:center'><a href='javascript:;' >删除</a></p></div>"
        $("#preview_muti").append(imgEl);
    });

    uploaderMuti.on( 'uploadError', function( file ) {
        layer.msg("上传出错了");
    });

    uploaderMuti.on( 'uploadComplete', function( file ) {
        //layer.msg("图片上传完成....");
    });
#end


#define webUploaderMutiBtn(objList,name)
<div id="uploader_muti" class="wu-example">
    <!--用来存放文件信息-->
    <div id="preview_muti" style="display:inline-flex;">
        #if(objList??)
            #for(obj:objList)
                <div style="padding:5px;" class="imgWrap">
                	<img src="#(obj??'')" class='img-item' width="100">
                	<p class="del-pic" style="text-align:center"><a href="javascript:;" >删除</a></p>
                </div>
            #end
        #end
    </div>
    <div class="btns">
        <div id="pickerMuti">选择图片集</div>
    </div>
    <input type="hidden" id="img_muti_hidden" name="#(name??'')" value="#(obj.cover??'')">
</div>
#end


#define navBar(title,path)
<div class="nav-container">
    #if(path=="")
    <div class="nav-item" onclick="window.history.go(-1)">
    #else
    <div class="nav-item" onclick="window.location.href='#(path??)'">
    #end
        <img class="icon-back" src="#(contextPath)/assets/front/img/icon/ic_keyboard_arrow_left_white_48dp.png">
    </div>
    <div class="nav-item nav-item-center">#(title??'未知')</div>
    <div class="nav-item"></div>
</div>
#end